package com.dyg.service.Impl;

import java.util.List;
import com.dyg.model.UserRole;
import com.dyg.dao.UserroleMapper;
import com.dyg.service.UserroleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class UserroleServiceImpl implements UserroleService {

	@Autowired
	private UserroleMapper userroleMapper;

	@Override
	public void insertUserrole(UserRole UserRole)	{
		this.userroleMapper.insertUserrole(UserRole);
	}

	@Override
	public void deleteUserroleById(String userroleId)	{
		this.userroleMapper.deleteUserroleById(userroleId);
	}

	@Override
	public void updateUserrole(UserRole UserRole)	{
		this.userroleMapper.updateUserrole(UserRole);
	}

	@Override
	public UserRole findUserroleById(String userroleId)	{
		return this.userroleMapper.findUserroleById(userroleId);
	}

	@Override
	public List<UserRole> findUserroleList()	{
		return this.userroleMapper.findUserroleList();
	}

	/**
     * 为单个用户设置多个角色
	 * @param userId
	 * @param rids
	 */
	@Override
	public Integer addUserRoles(Integer userId, List<Integer> rids) {
		return this.userroleMapper.addUserRoles(userId, rids);
	}

}
